/**
* Copyright (c) 2015 UNI-TREND Co., Ltd.
* All rights reserved.  
*  
* @file        
* @brief     
* @version     1.0 
* @author      
* @Email       
* @date        2015-12-3
*/
#include "ScopeSetup.h"
CSetup g_setup;
CSetup::CSetup()
{
    int i = 0;
    for(;i<SCOPE_SETUP_CH_MAX; i++)
        m_chArr[i] = new CSChannel();
    for(;i<SCOPE_SETUP_CH_MAX + SCOPE_SETUP_EXT_CH_MAX; i++)
        m_chArr[i] = new CSExtChannel();
    for(;i<SCOPE_SETUP_CH_MAX + SCOPE_SETUP_EXT_CH_MAX + SCOPE_SETUP_ANOLOG_CH_MAX; i++)
        m_chArr[i] = new CSAnologChannel();
    // TODO: check m_chArr not NULL
    m_horz = new CSHorizontal();
    m_trig = new CSTrigger();
    m_disp = new CSDisplay();
    m_acq  = new CSAcq();
    m_help = new CSHelp();
    m_apps = new CSApp();
    // not NULL
}
CSetup::~CSetup()
{
    for(int i=0; i<SCOPE_SETUP_CH_NUMS; i++)
    {
        delete m_chArr[i];
        m_chArr[i] = NULL;
    }
    delete m_horz;
    m_horz = NULL;
    delete m_trig;
    m_trig = NULL;
    delete m_disp;
    m_disp = NULL;
    delete m_acq;
    m_acq  = NULL;
    delete m_help;
    m_help = NULL;
    delete m_apps;
    m_apps = NULL;
}

